<template>
    <div>
      <AmapMap v-bind="$attrs" v-on="$listeners" v-if="baiduShow" ref="Baidu" />
      <!-- <BaiduMap v-bind="$attrs" v-on="$listeners" v-if="baiduShow" ref="Baidu" /> -->
      <GoogleMap v-bind="$attrs" v-on="$listeners" v-if="gmapShow" ref="gmap" />
    </div>
  </template>
  
  <script>
  import AmapMap from "./AmapMap";
  import BaiduMap from "./BaiduMap";
  import GoogleMap from "./GoogleMap";
  import { getMapType } from "@/utils/auth";
  
  export default {
    components: {
      AmapMap,
      GoogleMap,
      BaiduMap
    },
    inheritAttrs: false,
    data() {
      return {
        gmapShow: false,
        baiduShow: false,
      };
    },
    created() {
      //1.google,2.baidu.3.amap.4.tx
      if (getMapType() == 1) {
        this.gmapShow = true;
      }else{
        this.baiduShow = true;
      }
    },
  };
  </script>
  
  <style></style>
  